home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / dviapollo / check.c < prev    next >
C/C++ Source or Header  |  1990-10-01  |  363b  |  17 lines

  1. #include <stdio.h>
  2. /*This routine determines whether a given error code represents an error.  
  3. If it does, then we print an error message and bomb.  If it doesn't, then
  4. the code is the returned value of check.*/
  5.  
  6. int check (code)
  7. int code;
  8. {
  9.   if (code < 0) {
  10.     fprintf (stderr, "Unanticipated error:\n");
  11.     perror ("");
  12.     exit (1);
  13.   }
  14.   return (code);
  15. }
  16.  
  17.